﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using octopus_project.enumeration;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace octopus_project.tileset.mapCells {
    class NotConquered_MapCell : MapCell{

        public NotConquered_MapCell() {
            tileType = TileType.NOT_CONQUERED;
        }

        public override void paint(SpriteBatch spriteBatch, int x, int y, TileMap_GameplayEntry map) {
           
                TileType tileTypeTemp;

                if ((x % 2) == 0) {

                    if ((y % 2) == 0) {
                        tileTypeTemp = TileType.NOT_CONQUERED;
                    }
                    else {
                        tileTypeTemp = TileType.NOT_CONQUERED_B;
                    }

                }
                else {

                    if ((y % 2) == 0) {
                        tileTypeTemp = TileType.NOT_CONQUERED_B;
                    }
                    else {
                        tileTypeTemp = TileType.NOT_CONQUERED;
                    }
                }

                spriteBatch.Draw(
                    TileTypeExtensions.SpriteImage,
                    new Rectangle(x * Constant.TILE_SIDE, y * Constant.TILE_SIDE, Constant.TILE_SIDE, Constant.TILE_SIDE),
                    TileTypeExtensions.GetSourceRectangle(tileTypeTemp, PlayersColor.UNDEFINED),
                    Color.White);

            }

        public override MapCell build() {
            MapCell mapCell = new Wall_MapCell();
            mapCell.setValues(this);
            return mapCell;
        }

        public override bool isEnabledToBuild() {
            return true;
        }
        
    }
}
